import 'package:flutter/material.dart';
void main() => runApp(MyApp());
// MyApp继承于StatelessWidget静态组件
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: "first",
      // 脚手架组件
      home: Scaffold(
        appBar: new AppBar(
          leading:Icon(Icons.arrow_back),
          // elevation: 0.0,
          backgroundColor: Color.fromARGB(255, 139, 139, 122),
          centerTitle: true,
          title: new Text('ListView',
            style: TextStyle(
              color: Color.fromARGB(255, 0, 255, 255),
            ),
          ),
        ),
        //页面
        // 构建动态列表
        body: GridView.count(
          padding: const EdgeInsets.all(10.0),
            // 网格间的距离
            crossAxisSpacing: 10.0,
            // 每行显示列数
            crossAxisCount: 5,
            // 横和竖比例
            childAspectRatio: 0.7,
            mainAxisSpacing: 10.0,
            children: < Widget > [
              new Image.network('http://img5.mtime.cn/mt/2018/10/22/104316.77318635_180X260X4.jpg', fit: BoxFit.cover),
              new Image.network('http://img5.mtime.cn/mt/2018/10/10/112514.30587089_180X260X4.jpg', fit: BoxFit.cover),
              new Image.network('http://img5.mtime.cn/mt/2018/11/13/093605.61422332_180X260X4.jpg', fit: BoxFit.cover),
            ],
        )
      ),
    );
  }
}
class list extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ListView(
      scrollDirection: Axis.horizontal,
      children: < Widget > [
        // 容器
        new Container(
          width: 200.0,
          color: Color.fromARGB(255, 74, 233, 22),
        )
      ],
    );
  }
}